home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / Shells / zsh / Source / src / config / bz.doksh < prev    next >
Encoding:
Text File  |  1994-04-07  |  983 b   |  31 lines

  1. # --- ksh?
  2. # (hopefully sh does not barf before this point...)
  3. #
  4. # if we are not in ksh but we should try it
  5. #
  6. if test -n "$F_must_ksh" -o -n "$B_ksh"
  7. then
  8.   echo
  9. # the following trick should tell us whether we have ksh or
  10. # just bare sh: ksh has alias builtin, sh does not (I really hope that
  11. # no one has "alias" in their PATH as an executable, this trick
  12. # will fail major way...)
  13. (alias) >/dev/null 2>&1 && echo 'Now running ksh...' || {
  14.   set ksh ksh "/bin /usr/bin /usr/local/bin"
  15.   . bz.walk
  16.   if test -n "$ksh"
  17.   then
  18.     test -n "$F_cray" && echo "CRAY's /bin/sh cannot handle buildzsh, a stack overflow will occur."
  19.     test -n "$B_ksh"      && echo Will | tr -d '\012'
  20.     test -n "$F_must_ksh" && echo MUST | tr -d '\012'
  21.     echo " refeed ourselves through $ksh"
  22.     echo
  23.     exec $ksh $0 `cat $ARGV`
  24.     echo "Ooops, something went awfully wrong, failed to 'exec $ksh $0 `cat $ARGV`'"
  25.   else
  26.     echo 'Aaargh, we should run ksh but cannot find one.'
  27.   fi
  28.   exit 1
  29. }
  30. fi
  31.